<script setup>
import { ref } from 'vue'

// 轮播图数据
const bannerList = ref([
  { id: 1, imgUrl: new URL('@/assets/banner-images/12.jpg', import.meta.url).href },
  { id: 2, imgUrl: new URL('@/assets/banner-images/14.jpg', import.meta.url).href },
  { id: 3, imgUrl: new URL('@/assets/banner-images/16.jpg', import.meta.url).href },
  { id: 4, imgUrl: new URL('@/assets/banner-images/18.jpg', import.meta.url).href },
  { id: 5, imgUrl: new URL('@/assets/banner-images/20.jpg', import.meta.url).href },
  { id: 6, imgUrl: new URL('@/assets/banner-images/22.jpg', import.meta.url).href },
])
</script>

<template>
  <div class="home-banner">
    <el-carousel height="500px">
      <el-carousel-item v-for="item in bannerList" :key="item.id">
        <img :src="item.imgUrl" alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<style scoped lang="scss">
.home-banner {
  width: 1240px;
  height: 470px;
  position: relative;
  margin-bottom: 30px;

  img {
    width: 100%;
    height: 500px;
  }
}
</style>
